<template>
  <div class='header'>
    <div class="header-left">
      <span class='iconfont icon-back'>&#xe658;</span>
    </div>
    <div class="header-input">
      <span class='iconfont search'>&#xe63c;</span>
      <input type="text" placeholder="输入城市/景点">
    </div>
    <router-link tag='div' class="header-right" to='/city'>
      <span class='city'>{{city}}</span>
      <div class='icon-more-wrapper'>
        <span class='iconfont more'>&#xe65c;</span>
      </div>
    </router-link>
  </div>
</template>

<script>
import {mapState} from 'vuex'
export default {
  name: 'HomeHeader',
  computed: {
    ...mapState(['city'])
  }
}
</script>

<style lang="stylus" scoped>
@import '~@/assets/styles/varibles.styl';
.header
  display flex
  line-height $headerHeight
  color #fff
  background $bgColor
  .header-left
    text-align center
    float left
    width .64rem
    .icon-back
      font-size .4rem
  .header-input
    flex 1
    background #fff
    margin .14rem 0 0 .2rem
    height .64rem
    line-height .64rem
    padding-left .2rem
    border-radius .1rem
    .search
      color #ccc
    input
      padding-bottom .1rem
  .header-right
    float right
    min-width 1.04rem
    padding 0 .1rem
    color #fff
    text-align center
    .icon-more-wrapper
      float right
      padding 0 .1rem 0 .18rem
      .more
        font-size .45rem
        padding-top .1rem
    .city
      margin-right -.25rem
</style>
